#!/bin/bash
echo "post rm"

DATAPATH=/var/lib/opengauss
APPPATH=/usr/local/opengauss

## clear app
if [ -d ${APPPATH} ]; then
    rm -rf ${APPPATH}
fi

if [ -f {DATAPATH}/.bash_profile ]; then
    rm {DATAPATH}/.bash_profile
fi

## backup datadir
if [ -d ${DATAPATH}/data ]; then
    mv ${DATAPATH}/data ${DATAPATH}/data-$(date +"%Y-%m-%d-%H-%M-%S")-todelete
fi